/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tv.global.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author ctrosch
 */
@Embeddable
public class EstructuraDeConceptoPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "GRTCPH_MODULO", nullable = false, length = 2)
    private String modulo;
    @Basic(optional = false)
    @Column(name = "GRTCPH_TIPCPT", nullable = false)
    private char tipcpt;

    public EstructuraDeConceptoPK() {

    }

    public EstructuraDeConceptoPK(String modulo, char tipcpt) {
        this.modulo = modulo;
        this.tipcpt = tipcpt;
    }

    public String getModulo() {
        return modulo;
    }

    public void setModulo(String modulo) {
        this.modulo = modulo;
    }

    public char getTipcpt() {
        return tipcpt;
    }

    public void setTipcpt(char tipcpt) {
        this.tipcpt = tipcpt;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (modulo != null ? modulo.hashCode() : 0);
        hash += (int) tipcpt;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstructuraDeConceptoPK)) {
            return false;
        }
        EstructuraDeConceptoPK other = (EstructuraDeConceptoPK) object;
        if ((this.modulo == null && other.modulo != null) || (this.modulo != null && !this.modulo.equals(other.modulo))) {
            return false;
        }
        if (this.tipcpt != other.tipcpt) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.global.modelo.EstructuraDeConceptosPK[modulo=" + modulo + ", tipcpt=" + tipcpt + "]";
    }

}
